<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%   
	String path = request.getContextPath();   
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";   
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<jsp:include page="../inc/bootstrap.jsp"></jsp:include>
	<script type="text/javascript" src="<%=basePath%>static/layer/layer.js"></script>
	<style>
    @media only screen and (min-width: 1140px) {
	  .showBox {width: 1140px;margin: 0 auto;}
	}
	@media only screen and (min-width: 760px) and (max-width:1140px){
	  .showBox {width: 760px;margin: 0 auto;}
	}
	@media only screen and (max-width:760px){
	  .showBox {width: 100%;margin: 0 auto;}
	  .showBox ul li {width: 98%;}
	}
  </style>
</head>
<body>
<form action="" method="post" id="indexForm">
		<div class="showBox">	      	    
	       <ul class="indexone">
	        <li onclick="addTabs('今日订单量','orderController/getOrderList.do?type=1');">
	          <div class="show_icon">
	          <!-- <i class="glyphicon glyphicon-calendar"></i> -->
	          <img src="${basePath}static/images/dingdanliang.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
				<div class="show_name">订单量</div>
		       	<div class="show_item">
		         	<label class="curpointer">今日订单量</label>
		       	</div>
	          </div>
	          <div class="show_count">
	          	<span id="today_orderCount">-</span>
	          </div>	
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-usd"></i> -->
	          	<img src="${basePath}static/images/dingdane.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">订单额</div>
		          <div class="show_item">
		            <label>今日订单额</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="today_orderMoney">-</span>
	          </div>
	        </li>
	        <li onclick="addTabs('待确认订单','orderController/getOrderList.do?flag=1');">
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-inbox"></i> -->
	          	<img src="${basePath}static/images/daiqueren.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">待确认订单</div>
		          <div class="show_item">
		            <label class="curpointer">待确认订单</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="nocheck_orderCount">-</span>
	          </div>
	        </li>
	        <li onclick="addTabs('待收款订单','orderController/getOrderList.do?flag=2');">
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-usd"></i> -->
	          	<img src="${basePath}static/images/daishoukuan.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">待收款订单</div>
		          <div class="show_item">
		            <label class="curpointer">待收款订单</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="noaccept_orderMoney">-</span>
	          </div>
	        </li>
	        <li onclick="addTabs('今日新增会员','memberController/getMemberLists.do?flag=1');">
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-user"></i> -->
	          	<img src="${basePath}static/images/xinzenghuiyuan.png" width="50" height="50" />
	          </div>	
	          <div class="show_info">			
		          <div class="show_name">新增会员</div>
		          <div class="show_item">
		          	<label class="curpointer">今日新增会员</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="today_memberCount">-</span>
	          </div>
	        </li>
	        <li onclick="addTabs('会员总数','memberController/getMemberLists.do');">
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-user"></i> -->
	          	<img src="${basePath}static/images/huiyuanzongshu.png" width="50" height="50" />
	          </div>
	          <div class="show_info">			
		          <div class="show_name">会员总数</div>
		          <div class="show_item">
		          	<label class="curpointer">会员总数</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="total_memberCount">-</span>
	          </div>
	        </li>
	        </ul>
	      	      	     
	       <ul class="indextwo" style="display:none">
	        <li>
	          <div class="show_icon">
	          <!-- <i class="glyphicon glyphicon-calendar"></i> -->
	          <img src="${basePath}static/images/dingdanliang.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
				<div class="show_name">订单量</div>
		       	<div class="show_item">
		         	<label class="curpointer">今日订单量</label>
		       	</div>
	          </div>
	          <div class="show_count">
	          	<span id="today_orderCount">-</span>
	          </div>	
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-usd"></i> -->
	          	<img src="${basePath}static/images/dingdane.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">订单额</div>
		          <div class="show_item">
		            <label>今日订单额</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="today_orderMoney">-</span>
	          </div>
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-inbox"></i> -->
	          	<img src="${basePath}static/images/daiqueren.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">待确认订单</div>
		          <div class="show_item">
		            <label class="curpointer">待确认订单</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="nocheck_orderCount">-</span>
	          </div>
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-usd"></i> -->
	          	<img src="${basePath}static/images/daishoukuan.png" width="50" height="50" />
	          </div>
	          <div class="show_info">
		          <div class="show_name">待收款订单</div>
		          <div class="show_item">
		            <label class="curpointer">待收款订单</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="noaccept_orderMoney">-</span>
	          </div>
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-user"></i> -->
	          	<img src="${basePath}static/images/xinzenghuiyuan.png" width="50" height="50" />
	          </div>	
	          <div class="show_info">			
		          <div class="show_name">新增会员</div>
		          <div class="show_item">
		          	<label class="curpointer">今日新增会员</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="today_memberCount">-</span>
	          </div>
	        </li>
	        <li>
	          <div class="show_icon">
	          	<!-- <i class="glyphicon glyphicon-user"></i> -->
	          	<img src="${basePath}static/images/huiyuanzongshu.png" width="50" height="50" />
	          </div>
	          <div class="show_info">			
		          <div class="show_name">会员总数</div>
		          <div class="show_item">
		          	<label class="curpointer">会员总数</label>
		          </div>
	          </div>
	          <div class="show_count">
	          	<span id="total_memberCount">-</span>
	          </div>
	        </li>
	        </ul>	       	      	      
	    </div>
</form>	
</body>
<script>
sessionStorage.setItem('obj','');
if('${sessionUser.role_name}' == '医生'){
	$('.indexone').hide();
	$('.indextwo').show();
}else{
	layer.closeAll();
	$('.indexone').show();
	$('.indextwo').hide();
}
// 会员统计报表
$.ajax({
	type: "POST",
	url: '<%=basePath%>reportController/memberReport.do',
	dataType:'json',
	cache: false,
	success: function(data){
		/* console.log(data); */
		if (data.success){
			// 获取记录数量today_memberCount
			$("#today_memberCount").text(data.obj.today_memberCount);
			$("#total_memberCount").text(data.obj.total_memberCount);
			
		}else{
			$("#today_memberCount,#total_memberCount").text("*");
		}
	},
	error: function(){
		$("#today_memberCount,#total_memberCount").text("*");
	}
});

// 订单统计报表
$.ajax({
	type: "POST",
	url: '<%=basePath%>reportController/orderReport.do',
	dataType:'json',
	cache: false,
	success: function(data){
	//	//console.log(data);
		if (data.success){
			// 获取记录数量
			//今日订单量
			$("#today_orderCount").text(data.obj.today_orderCount);
			//今日订单额
			$("#today_orderMoney").text(data.obj.today_orderMoney);
			//待确认订单
			$("#nocheck_orderCount").text(data.obj.nocheck_orderCount);
			//待收款订单
			$("#noaccept_orderMoney").text(data.obj.noaccept_orderMoney);

		}else{
			$("#today_orderCount,#today_orderMoney,#nocheck_orderCount,#noaccept_orderMoney").text("*");
		}
	},
	error: function(){
		$("#today_orderCount,#today_orderMoney,#nocheck_orderCount,#noaccept_orderMoney").text("*");
	}
});
</script>
</html>